knitr::opts_chunk$set(echo = TRUE)
knitr::opts_knit$set(root.dir ='~/Documents/Projects/Short_Term_Broccoli/human_analysis/')
library(tidyverse)
library(magrittr)
library(lubridate)
library(plotly)

#Set Up Theme:
theme_sfn <- function(x){
  cowplot::theme_cowplot() %+replace%
  theme(
    update_geom_defaults('point', list(shape = 16, size = 4)),
    update_geom_defaults('path', list(size = 2))) 
}

#Set Cohort Colors:
chrt_col <- c('#E6122F', '#FAD20A', '#ED6700', '#6140B5', '#0A64FF', '#04B44A', '#49A9BA', '#C954A6')
chrt_1 <- c('#740615', '#9E0519', '#E6122F', '#B83E4F')
chrt_2 <- c('#FFEB85', '#FAD20A','#B59F31', '#806D12')
chrt_3 <- c('#ED6700', '#EB7E2B', '#B55810', '#F6A465')
chrt_4 <- c('#4F3494', '#54496E', '#705F9C', '#6140B5', '#8263CF', '#BAA2F6')
chrt_5 <- c('#0A64FF', '#003CA3', '#81A9EE')
chrt_6 <- c('#0C6F33', '#188C46', '#04B44A', '#1BDA67', '#86E9AE', '#96DFA3')
chrt_7 <- c('#15444D', '#0D7082', '#52939E', '#7DBECA', '#49A9BA', '#52D4EB', '#91E4F2', '#C8F2F9')
chrt_8 <- c('#9F1977', '#AB498E', '#C954A6')

BSS_col <- c(chrt_1, chrt_2, chrt_3, chrt_4, chrt_5, chrt_6, chrt_7, chrt_8)

#Set Broccoli and Alfalfa Colors:
BA_col <- c('#3AE151', '#DDE712')

#Set Label and Unlabeled Colors:
LUL_col <- c('#3A43E0', '#E81368')

#Useful Functions:
se <- function(x){
  sd(x)/sqrt(length(x))
}
#Metadata:
metadata_urine <- read_csv('~/Documents/Projects/Short_Term_Broccoli/Data/Metadata/Meta_urine.csv')
metadata_health <- read_csv('~/Documents/Projects/Short_Term_Broccoli/Data/Metadata/meta_health.csv')
metadata_sprout <- read_csv('~/Documents/Projects/Short_Term_Broccoli/Data/Metadata/sprout_meta.csv')
metadata_treatment <- read_csv('~/Documents/Projects/Short_Term_Broccoli/Data/Metadata/meta_treatment.csv')
metadata_fecal <- read_csv('~/Documents/Projects/Short_Term_Broccoli/Data/Metadata/meta_fecal_broconly.csv')

#Raw Data:
urine_raw <- read_csv('~/Documents/Projects/Short_Term_Broccoli/Data/SFN_Targeted/Urine/Urine_R_Format.csv')
fecal_raw <- read_csv('~/Documents/Projects/Short_Term_Broccoli/Data/SFN_Targeted/Fecal/Fecal_R_format.csv')
plasma_raw <- read_csv('~/Documents/Projects/Short_Term_Broccoli/Data/SFN_Targeted/Plasma/Plasma_R_Format.csv')

#Set Subject ID Color Names
subid <- metadata_treatment %>%
  filter(treatment %in% c('BU', 'BL')) %>%
  arrange(cohort) %>%
  pull(subject_id)
names(BSS_col) <- subid
pal_bss <- scale_color_manual(values = BSS_col)

#Set Cohort Color Names
names(chrt_col) <- 1:8
pal_chrt <- scale_color_manual(values = chrt_col)

#Set Broccoli Alfalfa Names:
names(BA_col) <- c('Broccoli', 'Alfalfa')
pal_ba <- scale_color_manual(values = BA_col)

#Set Label/Unlabel Names:
names(LUL_col) <- c('BL', 'BU')
pal_lb <- scale_color_manual(values = LUL_col)
#Urine:
#Clean the metadata
mdata_urine_clean <- metadata_urine %>%
  #Weight (grams) used as a  proxy for mL, convert to L
  mutate(across(c(4:9), ~.x/1000)) %>%
  #Pivot the data longer
  pivot_longer(cols = starts_with('vol'), names_to = 'time', values_to = 'volume') %>%
  #Rename the variables so they can treated as factors
  mutate(time = gsub('vol_', '', time)) %>%
  mutate(time = gsub('h','', time)) 

#Clean the urine data
urine_clean <- urine_raw %>%
  #Rename the time points so they match the metadata
  mutate(time = gsub('h','', time)) %>%
  #Join the data with the metadata
  left_join(., mdata_urine_clean) %>%
  group_by(subject_id, time) %>%
  #Multiply all the uM by the (proxy) volumes to convert to uMol recovered
  mutate(across(starts_with('SFN'), ~.x*volume)) %>%
  #Convert to factors for analysis + graphing
  modify_at(c('subject_id', 'time', 'cohort'), as.factor)
#Relevel the time variables to make it work
urine_clean$time %<>% fct_relevel(c('0', '3', '6', '24', '48', '72'))

urine_clean_sub <- urine_clean %>%
  filter(!cohort %in% c(1,2))


#Plasma:
plasma_clean <- plasma_raw %>%
  mutate(time = gsub('h','', time)) %>%
  #Join the data with the metadata
  left_join(., metadata_treatment) %>%
  #Convert to factors for analysis + graphing
  modify_at(c('subject_id', 'time', 'cohort'), as.factor) %>%
  modify_at(4:10, as.numeric) 
plasma_clean$time %<>% fct_relevel(c('0', '3', '6', '24', '48', '72'))

plasma_clean_sub <- plasma_clean %>%
  filter(!cohort %in% c(1,2))

#Fecal:
fecal_clean <- fecal_raw %>%
  rename_at(c('Treatment', 'Time'), tolower) %>%
  mutate(time = gsub('h','', time)) %>%
  #Join the data with the metadata
  left_join(., metadata_treatment) %>%
  #Convert to factors for analysis + graphing
  modify_at(c('subject_id', 'time', 'cohort'), as.factor) %>%
  modify_at(5:10, as.numeric) 
fecal_clean$time %<>% fct_relevel(c('0','24', '48', '72'))

fecal_clean_sub <- fecal_clean %>%
  filter(!cohort %in% c(1,2))

Sanity Check

First we want to check and make sure that our alfalfa samples have no SFN in them:

Plasma:

plasma_san <- plasma_clean_sub %>%
  mutate(treatment = ifelse(treatment %in% c('BL', 'BU'), 'Broccoli', 'Alfalfa')) %>%
  group_by(treatment, time) %>%
  summarise(mean_SFN = mean(SFN_Tot),
            SER = se(SFN_Tot))

psan <- ggplot(plasma_san, aes(x = treatment, y = mean_SFN, group = treatment, color = treatment)) +
  geom_point(aes(text = paste0('Mean SFN: ', round(mean_SFN, 3), ' µM \n',
                               'Standard Error: ', round(SER, 2)))) +
  facet_wrap(~time) +
  theme_sfn() +
  pal_ba +
  ylab('Mean Total SFN Metabolites (µM)') +
  xlab('Treatment') +
  guides(color = guide_legend('Treatment'))

ggplotly(psan, tooltip = 'text')
plasma_san_tab <- plasma_san %>%
  mutate(mse = paste0(round(mean_SFN, 3), '±', round(SER, 2))) %>%
  dplyr::select(treatment, time, mse) %>%
  pivot_wider(names_from = time, values_from = mse)

knitr::kable(plasma_san_tab)
treatment 0 3 6 24 48 72
Alfalfa 0±0 0±0 0±0 0±0 0±0 0±0
Broccoli 0±0 1.423±0.14 0.953±0.11 0.25±0.03 0.048±0.01 0.002±0

Urine

urine_san <- urine_clean_sub %>%
  mutate(treatment = ifelse(treatment %in% c('BL', 'BU'), 'Broccoli', 'Alfalfa')) %>%
  drop_na() %>%
  group_by(treatment, time) %>%
  summarise(mean_SFN = mean(SFN_Tot, rm.na = T),
            SER = se(SFN_Tot))

usan <- ggplot(urine_san, aes(x = treatment, y = mean_SFN, group = treatment, color = treatment)) +
  geom_point(aes(text = paste0('Mean SFN: ', round(mean_SFN, 3), ' µmol \n',
                               'Standard Error: ', round(SER, 2)))) +
  facet_wrap(~time) +
  theme_sfn() +
  pal_ba +
  ylab('Mean Total SFN Metabolites (µmol)') +
  xlab('Treatment') +
  guides(color = guide_legend('Treatment'))

ggplotly(usan, tooltip = 'text')
urine_san_tab <- urine_san %>%
  mutate(mse = paste0(round(mean_SFN, 3), '±', round(SER, 2))) %>%
  dplyr::select(treatment, time, mse) %>%
  pivot_wider(names_from = time, values_from = mse)

knitr::kable(urine_san_tab)
treatment 0 3 6 24 48 72
Alfalfa 0±0 0±0 0±0 0±0 0±0 0±0
Broccoli 0.002±0 27.227±2.29 36.585±3.09 36.123±2.92 5.028±0.52 0.67±0.12

Fecal

fecal_san <- fecal_clean_sub %>%
  mutate(treatment = ifelse(treatment %in% c('BL', 'BU'), 'Broccoli', 'Alfalfa')) %>%
  drop_na() %>%
  group_by(treatment, time) %>%
  summarise(mean_SFN = mean(SFN_Tot, rm.na = T),
            SER = se(SFN_Tot))

fsan <- ggplot(fecal_san, aes(x = treatment, y = mean_SFN, group = treatment, color = treatment)) +
  geom_point(aes(text = paste0('Mean SFN: ', round(mean_SFN, 3), ' nmol/g \n',
                               'Standard Error: ', round(SER, 2)))) +
  facet_wrap(~time) +
  theme_sfn() +
  pal_ba +
  ylab('Mean Total SFN Metabolites (nmol/g)') +
  xlab('Treatment') +
  guides(color = guide_legend('Treatment'))

ggplotly(fsan, tooltip = 'text')
fecal_san_tab <- fecal_san %>%
  mutate(mse = paste0(round(mean_SFN, 3), '±', round(SER, 2))) %>%
  dplyr::select(treatment, time, mse) %>%
  pivot_wider(names_from = time, values_from = mse)

knitr::kable(fecal_san_tab)
treatment 0 24 48 72
Alfalfa 0±NA 0±NA 0±NA 0±NA
Broccoli 0.024±0.02 0.723±0.29 0.209±0.06 0.088±0.03

Overall our data looks good and there is no SFN metabolites in the alfalfa samples. We will now switch over to only analyzing the broccoli data.

Question 1: Are there differences between Labeled and Unlabeled groups?

Before we combine the label and unlabeled data for analysis, we want to check and make sure there are no significant differences between the two. Let’s start with some boxplots.

#Filter our data to remove alfalfa folks
urine_clean_sub %<>% filter(treatment %in% c('BL', 'BU'))
plasma_clean_sub %<>% filter(treatment %in% c('BL', 'BU'))
fecal_clean_sub %<>% filter(treatment %in% c('BL', 'BU'))

urine_tidy <- urine_clean_sub %>%
  pivot_longer(cols = c(starts_with('SFN'),-SFN_Tot), names_to = 'metabolite', values_to = 'uMol')

plasma_tidy <- plasma_clean_sub %>%
  pivot_longer(cols = c(starts_with('SFN'),-SFN_Tot), names_to = 'metabolite', values_to = 'uMol')

fecal_tidy <- fecal_clean_sub %>%
  pivot_longer(cols = c(starts_with('SFN'),-SFN_Tot), names_to = 'metabolite', values_to = 'uMol')

Plasma

ggplot(plasma_clean_sub, aes(x = treatment, y = SFN_Tot, fill = treatment)) +
  geom_boxplot() +
  facet_wrap(~time, scales = 'free_y') +
  theme_sfn() +
  scale_fill_manual(values = LUL_col, 
                    labels = c('Labeled', 'Unlabeled'),
                    name = 'Treatment') +
  xlab('Treatment') +
  ylab('Total SFN Metabolites (µM)') +
  theme(axis.text.x = element_blank())

Urine

ggplot(urine_clean_sub, aes(x = treatment, y = SFN_Tot, fill = treatment)) +
  geom_boxplot() +
  facet_wrap(~time, scales = 'free_y') +
  theme_sfn() +
  scale_fill_manual(values = LUL_col, 
                    labels = c('Labeled', 'Unlabeled'),
                    name = 'Treatment') +
  xlab('Treatment') + 
  ylab('Total SFN Metabolites (µmol)') +
  theme(axis.text.x = element_blank())

Fecal

ggplot(fecal_clean_sub, aes(x = treatment, y = SFN_Tot, fill = treatment)) +
  geom_boxplot() +
  scale_fill_manual(values = LUL_col, 
                    labels = c('Labeled', 'Unlabeled'),
                    name = 'Treatment') +
  facet_wrap(~time, scales = 'free_y') +
  theme_sfn()  +
  xlab('Treatment') + 
  ylab('Total SFN Metabolites (µmol)') +
  theme(axis.text.x = element_blank())

The boxplots look pretty good, let’s run some simple stats now to check:

Without Time Factor

pc <- plasma_clean_sub %>%
  dplyr::select(subject_id, cohort, treatment, time, starts_with('SFN')) %>%
  inset('tissue', value = 'plasma')

uc <- urine_clean_sub %>%
  dplyr::select(subject_id, cohort, treatment, time, starts_with('SFN')) %>%
  inset('tissue', value = 'urine')

fc <- fecal_clean_sub %>%
  dplyr::select(subject_id, cohort, treatment, time, starts_with('SFN')) %>%
  inset('tissue', value = 'fecal')

colnames(uc) <- colnames(pc)
colnames(fc) <- colnames(pc)

allcom <- rbind(pc, uc, fc) %>%
  modify_at('tissue', as.factor)

labelt <- allcom %>%
  group_by(tissue) %>%
  nest() %>%
  mutate(pval = map_dbl(data, function(x) round(t.test(SFN_Tot ~ treatment, x)$p.value, 3))) %>%
  dplyr::select(-data)

knitr::kable(labelt)
tissue pval
plasma 0.773
urine 0.106
fecal 0.967

Stratified by Time

labelt_time <- allcom %>%
  group_by(tissue,time) %>%
  nest() %>%
  mutate(pval = map_dbl(data, function(x) round(t.test(SFN_Tot ~ treatment, x)$p.value, 3))) %>%
  dplyr::select(-data)

knitr::kable(labelt_time)
time tissue pval
0 plasma NaN
3 plasma 0.873
6 plasma 0.716
24 plasma 0.416
48 plasma 0.784
72 plasma 0.500
0 urine 0.397
3 urine 0.874
6 urine 0.007
24 urine 0.079
48 urine 0.201
72 urine 0.594
0 fecal 0.334
24 fecal 0.701
48 fecal 0.388
72 fecal 0.036

It looks like when time is considered, there is a significant difference between our labeled and unlabeled participants at 72hours for fecal samples only. Considering that every other sample and time point is non-significant, this is probably simply due to inter-individual variation. Moving forward, we will combine our labeled and unlabeled data.

Question 2: Are there differences between cohorts?

Plasma

pcbox <- plasma_clean_sub %>%
  group_by(cohort, subject_id) %>%
  summarise(total = sum(SFN_Tot))

ggplot(plasma_clean_sub, aes(x = cohort, y = SFN_Tot, fill = cohort)) +
  geom_boxplot() +
  facet_wrap(~time, scales = 'free_y') +
  theme_sfn() +
  scale_fill_manual(values = chrt_col,
                    name = 'Cohort') +
  xlab('Cohort') +
  ylab('Total SFN Metabolites (µM)')

Urine

ggplot(urine_clean_sub, aes(x = cohort, y = SFN_Tot, fill = cohort)) +
  geom_boxplot() +
  facet_wrap(~time, scales = 'free_y') +
  theme_sfn() +
  scale_fill_manual(values = chrt_col,
                    name = 'Cohort')  +
  xlab('Cohort') +
  ylab('Total SFN Metabolites (µmol)')

Fecal

ggplot(fecal_clean_sub, aes(x = cohort, y = SFN_Tot, fill = cohort)) +
  geom_boxplot() +
  facet_wrap(~time, scales = 'free_y') +
  theme_sfn() +
  scale_fill_manual(values = chrt_col,
                    name = 'Cohort')  +
  xlab('Cohort') +
  ylab('Total SFN Metabolites (nmol/g)')

From the plots alone, it looks like there is probably some sort of cohort effect happening, especially in the plasma. Let’s run some stats just to verify that:

cohortp_time <- allcom %>%
  group_by(tissue, time) %>%
  nest() %>%
  mutate(pval = map_dbl(data, function(x) round(anova(lm(SFN_Tot ~ cohort, x))$"Pr(>F)"[1], 3))) %>%
  dplyr::select(-data)
knitr::kable(cohortp_time)
time tissue pval
0 plasma NaN
3 plasma 0.000
6 plasma 0.000
24 plasma 0.000
48 plasma 0.070
72 plasma 0.136
0 urine 0.321
3 urine 0.817
6 urine 0.609
24 urine 0.782
48 urine 0.213
72 urine 0.265
0 fecal 0.490
24 fecal 0.160
48 fecal 0.218
72 fecal 0.478
cohortp <- allcom %>%
  group_by(tissue) %>%
  nest() %>%
  mutate(pval = map_dbl(data, function(x) round(anova(lm(SFN_Tot ~ cohort, x))$"Pr(>F)"[1], 3))) %>%
  dplyr::select(-data)
knitr::kable(cohortp)
tissue pval
plasma 0.001
urine 0.828
fecal 0.084

Regardless of time there is a significant difference between our cohorts, this isn’t necessarily surprising considering Cohort 1 consumed ~1.5x the amount of SFN compared to the other cohorts. For urine, since we know the aboslute volume of urine produced we can convert to percentage of dose recovered. Let’s complete that conversion and check for differences again.

metadata_sprout$cohort %<>% factor() 

urine_pct <- urine_clean_sub %>%
  ungroup() %>%
  left_join(metadata_sprout) %>%
  mutate(across(starts_with('SFN'), ~.x/SFN_fed))

ggplot(urine_pct, aes(x = cohort, y = SFN_Tot, fill = cohort)) +
  geom_boxplot() +
  facet_wrap(~time, scales = 'free_y') +
  theme_sfn() +
  scale_y_continuous(labels = scales::label_percent()) +
  scale_fill_manual(values = chrt_col,
                    name = 'Cohort')  +
  xlab('Cohort') +
  ylab('Total SFN Metabolites (µmol)')

Total SFN

cp <- urine_pct %>%
  group_by(time) %>%
  nest() %>%
  mutate(pval = map_dbl(data, function(x) round(anova(lm(SFN_Tot ~ cohort, x))$"Pr(>F)"[1], 3))) %>%
  dplyr::select(-data)

knitr::kable(cp)
time pval
0 0.318
3 0.470
6 0.463
24 0.529
48 0.129
72 0.232

NIT & NAC

cpmt <- urine_pct %>%
  dplyr::select(sample, cohort, subject_id, time, SFN_NAC, SFN_NIT) %>%
  pivot_longer(cols = starts_with('SFN'), names_to = 'metabolite', values_to = 'umol') %>%
  group_by(metabolite, time) %>%
  nest() %>%
  mutate(pval = map_dbl(data, function(x) round(anova(lm(umol ~ cohort, x))$"Pr(>F)"[1], 3))) %>%
  dplyr::select(-data)

knitr::kable(cpmt)
time metabolite pval
0 SFN_NAC 0.582
0 SFN_NIT 0.093
3 SFN_NAC 0.520
3 SFN_NIT 0.254
6 SFN_NAC 0.571
6 SFN_NIT 0.088
24 SFN_NAC 0.746
24 SFN_NIT 0.104
48 SFN_NAC 0.125
48 SFN_NIT 0.202
72 SFN_NAC 0.204
72 SFN_NIT 0.473

Unsurprisingly, we are seeing difference across both all metabolites and time points. Let’s see whats driving the differences:

cdata_list <- plasma_clean_sub %>%
  group_by(time) %>%
  nest() 

walk2(.x = cdata_list$data, 
      .y = list('0h', '3h', '6h', '24h', '48h', '72h'),
      function(x,y){
        print(y)
        print(summary(lm(SFN_Tot ~ cohort, data = x)))
      })
## [1] "0h"
## 
## Call:
## lm(formula = SFN_Tot ~ cohort, data = x)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
##      0      0      0      0      0 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)
## (Intercept)        0          0     NaN      NaN
## cohort4            0          0     NaN      NaN
## cohort5            0          0     NaN      NaN
## cohort6            0          0     NaN      NaN
## cohort7            0          0     NaN      NaN
## cohort8            0          0     NaN      NaN
## 
## Residual standard error: 0 on 24 degrees of freedom
## Multiple R-squared:    NaN,  Adjusted R-squared:    NaN 
## F-statistic:   NaN on 5 and 24 DF,  p-value: NA
## 
## [1] "3h"
## 
## Call:
## lm(formula = SFN_Tot ~ cohort, data = x)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.76333 -0.30603  0.04458  0.20566  0.82200 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  2.11450    0.19747  10.708 1.27e-10 ***
## cohort4      0.02383    0.25494   0.093  0.92629    
## cohort5      0.21250    0.30164   0.704  0.48792    
## cohort6     -1.28300    0.25494  -5.033 3.83e-05 ***
## cohort7     -1.32787    0.24185  -5.490 1.21e-05 ***
## cohort8     -1.07217    0.30164  -3.554  0.00161 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.3949 on 24 degrees of freedom
## Multiple R-squared:  0.7792, Adjusted R-squared:  0.7332 
## F-statistic: 16.94 on 5 and 24 DF,  p-value: 3.466e-07
## 
## [1] "6h"
## 
## Call:
## lm(formula = SFN_Tot ~ cohort, data = x)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.54367 -0.19437 -0.01738  0.15319  0.90833 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  1.60975    0.17938   8.974 3.90e-09 ***
## cohort4     -0.12775    0.23158  -0.552  0.58628    
## cohort5     -0.07408    0.27400  -0.270  0.78918    
## cohort6     -1.12925    0.23158  -4.876 5.69e-05 ***
## cohort7     -1.15400    0.21969  -5.253 2.19e-05 ***
## cohort8     -0.90608    0.27400  -3.307  0.00296 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.3588 on 24 degrees of freedom
## Multiple R-squared:  0.7196, Adjusted R-squared:  0.6612 
## F-statistic: 12.32 on 5 and 24 DF,  p-value: 5.47e-06
## 
## [1] "24h"
## 
## Call:
## lm(formula = SFN_Tot ~ cohort, data = x)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.166333 -0.079042 -0.004125  0.059375  0.299667 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  0.413250   0.057406   7.199 1.94e-07 ***
## cohort4      0.006083   0.074111   0.082 0.935260    
## cohort5      0.016083   0.087689   0.183 0.856014    
## cohort6     -0.301417   0.074111  -4.067 0.000445 ***
## cohort7     -0.316250   0.070308  -4.498 0.000149 ***
## cohort8     -0.215583   0.087689  -2.458 0.021550 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1148 on 24 degrees of freedom
## Multiple R-squared:  0.6841, Adjusted R-squared:  0.6183 
## F-statistic:  10.4 on 5 and 24 DF,  p-value: 2.135e-05
## 
## [1] "48h"
## 
## Call:
## lm(formula = SFN_Tot ~ cohort, data = x)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.08067 -0.02200 -0.01817  0.00725  0.15300 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)  
## (Intercept)  0.08000    0.02984   2.681   0.0131 *
## cohort4      0.01183    0.03852   0.307   0.7614  
## cohort5      0.01867    0.04558   0.410   0.6858  
## cohort6     -0.07500    0.03852  -1.947   0.0634 .
## cohort7     -0.05800    0.03655  -1.587   0.1256  
## cohort8     -0.05967    0.04558  -1.309   0.2029  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.05968 on 24 degrees of freedom
## Multiple R-squared:  0.3301, Adjusted R-squared:  0.1905 
## F-statistic: 2.365 on 5 and 24 DF,  p-value: 0.07025
## 
## [1] "72h"
## 
## Call:
## lm(formula = SFN_Tot ~ cohort, data = x)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.01667 -0.00025  0.00000  0.00000  0.03333 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)  
## (Intercept)  0.000250   0.004396   0.057   0.9551  
## cohort4      0.002250   0.005675   0.396   0.6952  
## cohort5      0.016417   0.006714   2.445   0.0222 *
## cohort6     -0.000250   0.005675  -0.044   0.9652  
## cohort7     -0.000250   0.005384  -0.046   0.9633  
## cohort8     -0.000250   0.006714  -0.037   0.9706  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.008791 on 24 degrees of freedom
## Multiple R-squared:  0.2813, Adjusted R-squared:  0.1315 
## F-statistic: 1.878 on 5 and 24 DF,  p-value: 0.1357

Unsurprisingly, it looks like the significance is being driven by Cohorts 6-8 which was when we were most confident about the amount of SFN we were feeding to our participants.

Question 3: What does timecourse of our different metabolites look like?

Distribution of each metabolite over time:

Plasma:

Bar Chart
metab_col <- c('#EF476F', '#F8961E', '#06D6A0', '#118AB2', '#7400B8', '#073B4C')
names(metab_col) <- rev(unique(plasma_tidy$metabolite))

plasma_dist <- plasma_tidy %>%
  group_by(metabolite, time) %>%
  summarise(mean = mean(uMol, na.rm = TRUE),
            ser = se(uMol))


ggplot(plasma_dist, aes(x = time, y = mean, fill = metabolite)) +
  geom_col() +
  theme_sfn() +
  scale_fill_manual(values = metab_col, name = 'Metabolite') + 
  xlab('Time (Hours)') +
  ylab('Mean Total SFN Metabolites (µM)')

Line Chart
ggplot(plasma_dist, aes(x = time, y = mean, color = metabolite)) +
  geom_errorbar(aes(ymin = mean - ser, ymax = mean+ser)) +
  geom_point() +
  geom_path(aes(group = metabolite)) +
  theme_sfn() +
  scale_color_manual(values = metab_col, name = 'Metabolite') +
  xlab('Time (Hours)') +
  ylab('Mean Total SFN Metabolites (µM)')

Urine

Bar Chart
urine_dist <- urine_tidy %>%
  drop_na() %>%
  group_by(metabolite, time) %>%
  summarise(mean = mean(uMol, na.rm = TRUE),
            ser = se(uMol))

ggplot(urine_dist, aes(x = time, y = mean, fill = metabolite)) +
  geom_col() +
  theme_sfn() +
  scale_fill_manual(values = metab_col, 
                    name = 'Metabolite') +
  xlab('Time (Hours)') +
  ylab('Mean Total SFN Metabolites (µmol)')

Bar Chart
ggplot(urine_dist, aes(x = time, y = mean, color = metabolite)) +
  geom_point() +
  geom_path(aes(group = metabolite)) +
  geom_errorbar(aes(ymin = mean - ser, ymax = mean+ser)) +
  theme_sfn() +
  scale_color_manual(values = metab_col, name = 'Metabolite') +
  xlab('Time (Hours)') +
  ylab('Mean Total SFN Metabolites (µmol)')

Fecal

Bar Chart
fecal_dist <- fecal_tidy %>%
  drop_na() %>%
  group_by(metabolite, time) %>%
  summarise(mean = mean(uMol, na.rm = T),
            ser = se(uMol))

ggplot(fecal_dist, aes(x = time, y = mean, fill = metabolite)) +
  geom_col() +
  theme_sfn() +
  scale_fill_manual(values = metab_col, name = 'Metabolite') +
  xlab('Time (Hours)') +
  ylab('Mean Total SFN Metabolites (µmol)')

Line Chart
ggplot(fecal_dist, aes(x = time, y = mean, color = metabolite)) +
  geom_errorbar(aes(ymin = mean - ser, ymax = mean+ser)) +
  geom_point() +
  geom_path(aes(group = metabolite)) +
  theme_sfn() +
  scale_color_manual(values = metab_col, name = 'Metabolite') +
  xlab('Time (Hours)') +
  ylab('Mean Total SFN Metabolites (µmol)')

Interindividual Variation of Each Metabolite

All results presented as percent of dose fed recovered to correct for cohorts 1-4 consuming unequal amounts of SFN

Plasma

All Metabolites
ppt <- ggplot(plasma_clean_sub, aes(x = time, y = SFN_Tot, group = subject_id, color = subject_id)) +
  geom_bar(aes(group = time), stat = 'summary', fun = mean, fill = 'grey', color = 'black', alpha = 0.5) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'Total SFN: ', round(SFN_Tot, 3), ' µM \n'))) +
  geom_path() +
  theme_sfn() +
  scale_color_manual(values = BSS_col, name = 'Subject') +
  xlab('Time (Hours)') +
  ylab('Total SFN Metaboeites (µM)')
  
plotly::ggplotly(ppt, tooltip = 'text')
SFN-NIT
pntc <- ggplot(plasma_clean_sub, aes(x = time, y = SFN_NIT, group = subject_id, color = subject_id)) +
  geom_bar(aes(group = time),stat = 'summary', fun = mean, fill = 'grey', color = 'black', alpha = 0.5) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'SFN-NIT: ', round(SFN_NIT, 3), ' µM \n'))) +
  geom_path() +
  theme_sfn() +
  scale_color_manual(values = BSS_col, name = 'Subject') +
  xlab('Time (Hours)') +
  ylab('SFN-NIT (µM)')

ggplotly(pntc, tooltip = 'text')
SFN-GSH
pgtc <- ggplot(plasma_clean_sub, aes(x = time, y = SFN_GSH, group = subject_id, color = subject_id)) +
  geom_bar(aes(group = time),stat = 'summary', fun = mean, fill = 'grey', color = 'black', alpha = 0.5) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'SFN-GSH: ', round(SFN_GSH, 3), ' µM \n'))) +
  geom_path() +
  theme_sfn() +
  scale_color_manual(values = BSS_col, name = 'Subject') +
  xlab('Time (Hours)') +
  ylab('SFN-GSH (µM)')

ggplotly(pgtc, tooltip = 'text')
SFN-CG
pcgtc <- ggplot(plasma_clean_sub, aes(x = time, y = SFN_CG, group = subject_id, color = subject_id)) +
  geom_bar(aes(group = time),stat = 'summary', fun = mean, fill = 'grey', color = 'black', alpha = 0.5) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'SFN-CG: ', round(SFN_CG, 3), ' µM \n'))) +
  geom_path() +
  theme_sfn() +
  scale_color_manual(values = BSS_col, name = 'Subject') +
  xlab('Time (Hours)') +
  ylab('SFN-CG (µM)')
  
  
ggplotly(pcgtc, tooltip = 'text')
SFN-Cys
pctc <- ggplot(plasma_clean_sub, aes(x = time, y = SFN_Cys, group = subject_id, color = subject_id)) +
  geom_bar(aes(group = time),stat = 'summary', fun = mean, fill = 'grey', color = 'black', alpha = 0.5) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'SFN-Cys: ', round(SFN_Cys, 3), ' µM \n'))) +
  geom_path() +
  theme_sfn() +
  scale_color_manual(values = BSS_col, name = 'Subject') +
  xlab('Time (Hours)') +
  ylab('SFN-Cys (µM)')


ggplotly(pctc, tooltip = 'text')
SFN-NAC
pnctc <- ggplot(plasma_clean_sub, aes(x = time, y = SFN_NAC, group = subject_id, color = subject_id)) +
  geom_bar(aes(group = time),stat = 'summary', fun = mean, fill = 'grey', color = 'black', alpha = 0.5) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'SFN-NAC: ', round(SFN_NAC, 3), ' µM \n'))) +
  
  geom_path() +
  theme_sfn() +
  scale_color_manual(values = BSS_col, name = 'Subject') +
  xlab('Time (Hours)') +
  ylab('SFN-NAC (µM)')

ggplotly(pnctc, tooltip = 'text')
SFN
pstc <- ggplot(plasma_clean_sub, aes(x = time, y = SFN, group = subject_id, color = subject_id)) +
  geom_bar(aes(group = time),stat = 'summary', fun = mean, fill = 'grey', color = 'black', alpha = 0.5) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'SFN: ', round(SFN, 3), ' µM \n'))) +
  geom_path() +
  theme_sfn() +
  scale_color_manual(values = BSS_col, name = 'Subject') +
  xlab('Time (Hours)') +
  ylab('SFN (µM)')

ggplotly(pstc, tooltip = 'text')

Urine - µmol Recovered

All Metabolites
utc <- ggplot(urine_clean_sub, aes(x = time, y = SFN_Tot, group = subject_id, color = subject_id)) +
  geom_bar(aes(group = time),stat = 'summary', fun = mean, fill = 'grey', color = 'black', alpha = 0.5) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'Total SFN: ', round(SFN_Tot, 3), ' µmol \n'))) +
  geom_path() +
  theme_sfn() +
  scale_color_manual(values = BSS_col, name = 'Subject') +
  xlab('Time (Hours)') +
  ylab('Total SFN Metabolites (µmol)')

ggplotly(utc, tooltip = 'text')
SFN-NIT
untc <- ggplot(urine_clean_sub, aes(x = time, y = SFN_NIT, group = subject_id, color = subject_id)) +
  geom_bar(aes(group = time),stat = 'summary', fun = mean, fill = 'grey', color = 'black', alpha = 0.5) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'SFN-NIT: ', round(SFN_NIT, 3), ' µmol \n'))) +
  geom_path() +
  theme_sfn() +
  scale_color_manual(values = BSS_col, name = 'Subject') +
  xlab('Time (Hours)') +
  ylab('SFN-NIT (µmol)')


ggplotly(untc, tooltip = 'text')
SFN-GSH
ugtc <- ggplot(urine_clean_sub, aes(x = time, y = SFN_GSH, group = subject_id, color = subject_id)) +
  geom_bar(aes(group = time),stat = 'summary', fun = mean, fill = 'grey', color = 'black', alpha = 0.5) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'SFN-GSH: ', round(SFN_GSH, 3), ' µmol \n'))) +
  geom_path() +
  theme_sfn() +
  scale_color_manual(values = BSS_col, name = 'Subject') +
  xlab('Time (Hours)') +
  ylab('SFN-GSH (µmol)')
 
ggplotly(ugtc, tooltip = 'text')
SFN-CG
ucgtc <- ggplot(urine_clean_sub, aes(x = time, y = SFN_CG, group = subject_id, color = subject_id)) +
  geom_bar(aes(group = time),stat = 'summary', fun = mean, fill = 'grey', color = 'black', alpha = 0.5) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'SFN-CG: ', round(SFN_CG, 3), ' µmol \n'))) +
  geom_path() +
  theme_sfn() +
  scale_color_manual(values = BSS_col, name = 'Subject') +
  xlab('Time (Hours)') +
  ylab('SFN-CG (µmol)')

ggplotly(ucgtc, tooltip = 'text')
SFN-Cys
uctc <- ggplot(urine_clean_sub, aes(x = time, y = SFN_Cys, group = subject_id, color = subject_id)) +
  geom_bar(aes(group = time),stat = 'summary', fun = mean, fill = 'grey', color = 'black', alpha = 0.5) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'SFN-Cys: ', round(SFN_Cys, 3), ' µmol \n'))) +
  geom_path() +
  theme_sfn() +
  scale_color_manual(values = BSS_col, name = 'Subject') +
  xlab('Time (Hours)') +
  ylab('SFN-Cys (µmol)')

ggplotly(uctc, tooltip = 'text')
SFN-NAC
unatc <- ggplot(urine_clean_sub, aes(x = time, y = SFN_NAC, group = subject_id, color = subject_id)) +
  geom_bar(aes(group = time),stat = 'summary', fun = mean, fill = 'grey', color = 'black', alpha = 0.5) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'SFN-NAC: ', round(SFN_NAC, 3), ' µmol \n'))) +
  geom_path() +
  theme_sfn() +
  scale_color_manual(values = BSS_col, name = 'Subject') +
  xlab('Time (Hours)') +
  ylab('SFN-NAC (µmol)')

ggplotly(unatc, tooltip = 'text')
SFN
ustc <- ggplot(urine_clean_sub, aes(x = time, y = SFN, group = subject_id, color = subject_id)) +
  geom_bar(aes(group = time),stat = 'summary', fun = mean, fill = 'grey', color = 'black', alpha = 0.5) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'SFN: ', round(SFN, 3), ' µmol \n'))) +
  geom_path() +
  theme_sfn() +
  scale_color_manual(values = BSS_col, name = 'Subject') +
  xlab('Time (Hours)') +
  ylab('SFN (µmol)')


ggplotly(ustc, tooltip = 'text')

Urine - % Dose Recovered

All Metabolites
utcp <- ggplot(urine_pct, aes(x = time, y = SFN_Tot, group = subject_id, color = subject_id)) +
  geom_bar(aes(group = time),stat = 'summary', fun = mean, fill = 'grey', color = 'black', alpha = 0.5) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'Total SFN: ', round(SFN_Tot*100, 2), ' % Dose \n'))) +
  geom_path() +
  theme_sfn() +
  scale_color_manual(values = BSS_col, name = 'Subject') +
  scale_y_continuous(labels = scales::label_percent()) +
  xlab('Time (Hours)') +
  ylab('Total SFN Metabolites (% Dose)')

ggplotly(utcp, tooltip = 'text')
SFN-NIT
untcp <- ggplot(urine_pct, aes(x = time, y = SFN_NIT, group = subject_id, color = subject_id)) +
  geom_bar(aes(group = time),stat = 'summary', fun = mean, fill = 'grey', color = 'black', alpha = 0.5) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'SFN-NIT: ', round(SFN_NIT*100, 2), ' % Dose \n'))) +
  geom_path() +
  theme_sfn() +
  scale_y_continuous(labels = scales::label_percent()) +
  scale_color_manual(values = BSS_col, name = 'Subject') +
  xlab('Time (Hours)') +
  ylab('SFN-NIT (% Dose)')


ggplotly(untcp, tooltip = 'text')
SFN-GSH
ugtcp <- ggplot(urine_pct, aes(x = time, y = SFN_GSH, group = subject_id, color = subject_id)) +
  geom_bar(aes(group = time),stat = 'summary', fun = mean, fill = 'grey', color = 'black', alpha = 0.5) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'SFN-GSH: ', round(SFN_GSH*100, 2), ' % Dose \n'))) +
  geom_path() +
  theme_sfn() +
  scale_y_continuous(labels = scales::label_percent()) +
  scale_color_manual(values = BSS_col, name = 'Subject') +
  xlab('Time (Hours)') +
  ylab('SFN-GSH (% Dose)')
 
ggplotly(ugtcp, tooltip = 'text')
SFN-CG
ucgtcp <- ggplot(urine_pct, aes(x = time, y = SFN_CG, group = subject_id, color = subject_id)) +
  geom_bar(aes(group = time),stat = 'summary', fun = mean, fill = 'grey', color = 'black', alpha = 0.5) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'SFN-CG: ', round(SFN_CG*100, 2), ' % Dose \n'))) +
  geom_path() +
  theme_sfn() +
  scale_color_manual(values = BSS_col, name = 'Subject') +
  scale_y_continuous(labels = scales::label_percent()) +
  xlab('Time (Hours)') +
  ylab('SFN-CG (% Dose)')

ggplotly(ucgtcp, tooltip = 'text')
SFN-Cys
uctcp <- ggplot(urine_pct, aes(x = time, y = SFN_Cys, group = subject_id, color = subject_id)) +
  geom_bar(aes(group = time),stat = 'summary', fun = mean, fill = 'grey', color = 'black', alpha = 0.5) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'SFN-Cys: ', round(SFN_Cys*100, 2), ' % Dose \n'))) +
  geom_path() +
  theme_sfn() +
  scale_y_continuous(labels = scales::label_percent()) +
  scale_color_manual(values = BSS_col, name = 'Subject') +
  xlab('Time (Hours)') +
  ylab('SFN-Cys (% Dose)')

ggplotly(uctcp, tooltip = 'text')
SFN-NAC
unatcp <- ggplot(urine_pct, aes(x = time, y = SFN_NAC, group = subject_id, color = subject_id)) +
  geom_bar(aes(group = time),stat = 'summary', fun = mean, fill = 'grey', color = 'black', alpha = 0.5) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'SFN-NAC: ', round(SFN_NAC*100, 2), ' % Dose \n'))) +
  geom_path() +
  theme_sfn() +
  scale_y_continuous(labels = scales::label_percent()) +
  scale_color_manual(values = BSS_col, name = 'Subject') +
  xlab('Time (Hours)') +
  ylab('SFN-NAC (% Dose)')

ggplotly(unatcp, tooltip = 'text')
SFN
ustcp <- ggplot(urine_pct, aes(x = time, y = SFN, group = subject_id, color = subject_id)) +
  geom_bar(aes(group = time),stat = 'summary', fun = mean, fill = 'grey', color = 'black', alpha = 0.5) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'SFN: ', round(SFN*100, 2), ' % Dose \n'))) +
  geom_path() +
  theme_sfn() +
  scale_y_continuous(labels = scales::label_percent()) +
  scale_color_manual(values = BSS_col, name = 'Subject') +
  xlab('Time (Hours)') +
  ylab('SFN (% Dose)')


ggplotly(ustcp, tooltip = 'text')

Fecal

All Metabolites
ftc <- ggplot(fecal_clean_sub, aes(x = time, y = SFN_Tot, group = subject_id, color = subject_id)) +
  geom_bar(aes(group = time),stat = 'summary', fun = mean, fill = 'grey', color = 'black', alpha = 0.5) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'Total SFN Metabolites: ', round(SFN_Tot, 3), ' nmol/g \n'))) +
  geom_path() +
  theme_sfn() +
  scale_color_manual(values = BSS_col, name = 'Subject') +
  xlab('Time (Hours)') +
  ylab('Total SFN Metabolites (nmol/g)')

ggplotly(ftc, tooltip = 'text')
SFN-NIT
fntc <- ggplot(fecal_clean_sub, aes(x = time, y = SFN_NIT, group = subject_id, color = subject_id)) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'SFN-NIT: ', round(SFN_NIT, 3), ' nmol/g \n'))) +
  geom_path() +
  theme_sfn() +
  scale_color_manual(values = BSS_col, name = 'Subject') +
  xlab('Time (Hours)') +
  ylab('SFN-NIT (nmol/g)')


ggplotly(fntc, tooltip = 'text')
SFN-GSH
fgtc <- ggplot(fecal_clean_sub, aes(x = time, y = SFN_GSH, group = subject_id, color = subject_id)) +
  geom_bar(aes(group = time),stat = 'summary', fun = mean, fill = 'grey', color = 'black', alpha = 0.5) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'SFN-GSH: ', round(SFN_GSH, 3), ' nmol/g \n'))) +
  geom_path() +
  theme_sfn() +
  scale_color_manual(values = BSS_col, name = 'Subject') +
  xlab('Time (Hours)') +
  ylab('SFN-GSH (nmol/g)')


ggplotly(fgtc, tooltip = 'text')
SFN-CG
fcgtc <- ggplot(fecal_clean_sub, aes(x = time, y = SFN_CG, group = subject_id, color = subject_id)) +
  geom_bar(aes(group = time),stat = 'summary', fun = mean, fill = 'grey', color = 'black', alpha = 0.5) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'SFN-CG: ', round(SFN_CG, 3), ' nmol/g \n'))) +
  geom_path() +
  theme_sfn() +
  scale_color_manual(values = BSS_col, name = 'Subject') +
  xlab('Time (Hours)') +
  ylab('SFN-CG (nmol/g)')


ggplotly(fcgtc, tooltip = 'text')
SFN-Cys
fctc <- ggplot(fecal_clean_sub, aes(x = time, y = SFN_Cys, group = subject_id, color = subject_id)) +
  geom_bar(aes(group = time),stat = 'summary', fun = mean, fill = 'grey', color = 'black', alpha = 0.5) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'SFN-Cys: ', round(SFN_Cys, 3), ' nmol/g \n'))) +
  geom_path() +
  theme_sfn() +
  scale_color_manual(values = BSS_col, name = 'Subject') +
  xlab('Time (Hours)') +
  ylab('SFN-Cys (nmol/g)')

ggplotly(fctc, tooltip = 'text')
SFN-NAC
fnatc <- ggplot(fecal_clean_sub, aes(x = time, y = SFN_NAC, group = subject_id, color = subject_id)) +
  geom_bar(aes(group = time),stat = 'summary', fun = mean, fill = 'grey', color = 'black', alpha = 0.5) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'SFN-NAC: ', round(SFN_NAC, 3), ' nmol/g \n'))) +
  geom_path() +
  theme_sfn() +
  scale_color_manual(values = BSS_col, name = 'Subject') +
  xlab('Time (Hours)') +
  ylab('SFN-NAC (nmol/g)')


ggplotly(fnatc, tooltip = 'text')
SFN
fstc <- ggplot(fecal_clean_sub, aes(x = time, y = SFN, group = subject_id, color = subject_id)) +
  geom_bar(aes(group = time),stat = 'summary', fun = mean, fill = 'grey', color = 'black', alpha = 0.5) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'SFN: ', round(SFN, 3), ' nmol/g \n'))) +
  geom_path() +
  theme_sfn() +
  scale_color_manual(values = BSS_col, name = 'Subject') +
  xlab('Time (Hours)') +
  ylab('SFN (nmol/g)')

ggplotly(fstc, tooltip = 'text')

Question 4: Is there a relationship between metabolite production in different compartments?

This question is a little tricky to answer because the peak metabolite production of each tissue occurs at different times. There are a few ways we can handle this:

  1. Examine cumulative excretion of each metabolite in each tissue (remove the time component)
urine_cum <- urine_tidy %>%
  group_by(subject_id, metabolite) %>%
  summarise(total = sum(uMol)) 

plasma_cum <- plasma_tidy %>%
  group_by(subject_id, metabolite) %>%
  summarise(total = sum(uMol))

fecal_cum <- fecal_tidy %>%
  group_by(subject_id, metabolite) %>%
  summarise(total_fl = sum(uMol))

ccor <- left_join(urine_cum, plasma_cum, by = c('subject_id', 'metabolite'), suffix = c('_ur', '_pl')) %>%
  left_join(., fecal_cum, by = c('subject_id', 'metabolite')) %>%
  group_by(metabolite) %>%
  drop_na() %>%
  nest() %>%
  mutate(UrvPl = map_dbl(data, function(x) round(cor(x$total_ur, x$total_pl), 3))) %>%
  mutate(UrvFl = map_dbl(data, function(x) round(cor(x$total_ur, x$total_fl), 3))) %>%
  mutate(PlvFl = map_dbl(data, function(x) round(cor(x$total_pl, x$total_fl), 3))) %>%
  dplyr::select(-data)


knitr::kable(ccor)
metabolite UrvPl UrvFl PlvFl
SFN 0.466 -0.001 0.131
SFN_CG 0.244 NA NA
SFN_Cys 0.388 -0.095 0.031
SFN_GSH -0.009 NA NA
SFN_NAC 0.582 0.567 0.377
SFN_NIT 0.659 0.082 0.121

Unsurprisingly, for most metabolites there is a positive correlation. Let’s look specifically at the maximal excretion time points for our study:

Plasma: 3 hours

Urine: 6 hours

Fecal: 24 hours

  1. Pairwise compare each time point of each tissue
pl3 <- plasma_tidy %>%
  filter(time == 3) 

ur6 <- urine_tidy %>%
  filter(time == 6)

fl24 <- fecal_tidy %>%
  filter(time == 24)

tcor <- left_join(ur6, pl3, by = c('subject_id', 'metabolite'), suffix = c('_ur', '_pl')) %>%
  left_join(., fl24, by = c('subject_id', 'metabolite')) %>%
  group_by(metabolite) %>%
  drop_na() %>%
  nest() %>%
  mutate(UrvPl = map_dbl(data, function(x) round(cor(x$uMol_ur, x$uMol_pl), 3))) %>%
  mutate(UrvFl = map_dbl(data, function(x) round(cor(x$uMol_ur, x$uMol), 3))) %>%
  mutate(PlvFl = map_dbl(data, function(x) round(cor(x$uMol_pl, x$uMol), 3))) %>%
  dplyr::select(-data)

knitr::kable(tcor)
metabolite UrvPl UrvFl PlvFl
SFN 0.447 -0.036 0.243
SFN_Cys 0.428 -0.111 0.004
SFN_NAC 0.414 0.491 0.123
SFN_CG 0.066 NA NA
SFN_GSH -0.070 NA NA
SFN_NIT 0.574 0.240 0.151

We are also interested in cross metabolite comparisons, specifically with NIT and other metabolites:

Plasma

Nitp <- plasma_clean_sub %>%
  drop_na() %>%
  group_by(time) %>%
  nest() %>%
  mutate(NITvNAC = map_dbl(data, function(x) round(cor(x$SFN_NIT, x$SFN_NAC), 3))) %>%
  mutate(NITvCys = map_dbl(data, function(x) round(cor(x$SFN_NIT, x$SFN_Cys), 3))) %>%
  mutate(NITvGSH = map_dbl(data, function(x) round(cor(x$SFN_NIT, x$SFN_GSH), 3))) %>%
  mutate(NITvCG = map_dbl(data, function(x) round(cor(x$SFN_NIT, x$SFN_CG), 3))) %>%
  mutate(NITvSFN = map_dbl(data, function(x) round(cor(x$SFN_NIT, x$SFN), 3))) %>%
  dplyr::select(-data)

knitr::kable(Nitp)
time NITvNAC NITvCys NITvGSH NITvCG NITvSFN
0 NA NA NA NA NA
3 0.539 0.731 0.722 0.683 0.621
6 0.600 0.673 0.753 0.730 0.607
24 0.183 NA NA NA NA
48 NA NA NA NA NA
72 NA NA NA NA NA

Urine

Nitu <- urine_clean_sub %>%
  drop_na() %>%
  group_by(time) %>%
  nest() %>%
  mutate(NITvNAC = map_dbl(data, function(x) round(cor(x$SFN_NIT, x$SFN_NAC), 3))) %>%
  mutate(NITvCys = map_dbl(data, function(x) round(cor(x$SFN_NIT, x$SFN_Cys), 3))) %>%
  mutate(NITvGSH = map_dbl(data, function(x) round(cor(x$SFN_NIT, x$SFN_GSH), 3))) %>%
  mutate(NITvCG = map_dbl(data, function(x) round(cor(x$SFN_NIT, x$SFN_CG), 3))) %>%
  mutate(NITvSFN = map_dbl(data, function(x) round(cor(x$SFN_NIT, x$SFN), 3))) %>%
  dplyr::select(-data)

knitr::kable(Nitu)
time NITvNAC NITvCys NITvGSH NITvCG NITvSFN
0 -0.034 -0.043 NA -0.034 NA
3 0.516 0.344 NA -0.060 0.502
6 0.690 0.522 -0.181 -0.062 0.461
24 0.528 0.336 NA -0.128 0.318
48 0.465 0.533 NA NA NA
72 0.068 0.659 NA NA NA

Fecal

Nitf <- fecal_clean_sub %>%
  drop_na() %>%
  group_by(time) %>%
  nest() %>%
  mutate(NITvNAC = map_dbl(data, function(x) round(cor(x$SFN_NIT, x$SFN_NAC), 3))) %>%
  mutate(NITvCys = map_dbl(data, function(x) round(cor(x$SFN_NIT, x$SFN_Cys), 3))) %>%
  mutate(NITvGSH = map_dbl(data, function(x) round(cor(x$SFN_NIT, x$SFN_GSH), 3))) %>%
  mutate(NITvCG = map_dbl(data, function(x) round(cor(x$SFN_NIT, x$SFN_CG), 3))) %>%
  mutate(NITvSFN = map_dbl(data, function(x) round(cor(x$SFN_NIT, x$SFN), 3))) %>%
  mutate(NACvSFN = map_dbl(data, function(x) round(cor(x$SFN_NAC, x$SFN), 3))) %>%
  dplyr::select(-data)

knitr::kable(Nitf)
time NITvNAC NITvCys NITvGSH NITvCG NITvSFN NACvSFN
0 NA NA NA NA NA -0.050
24 -0.045 0.11 NA NA 0.309 0.586
48 NA NA NA NA NA NA
72 NA NA NA NA 0.009 NA

Overall it seems that people that are good at converting GRP to SFN are good at it for all metabolites.

Question 5: Is there a relationship between the time someone produces a fecal sample and the amount of SFN in the sample?

fecal_dif <- metadata_fecal %>%
  modify_at(4:11, mdy_hm) %>%
  mutate(dif_0h = as.numeric(difftime(`0h_processed`,`0h_produced`, units = 'hours'))) %>%
  mutate(dif_24h = as.numeric(difftime(`24h_processed`,`24h_produced`, units = 'hours'))) %>%
  mutate(dif_48h = as.numeric(difftime(`48h_processed`,`48h_produced`, units = 'hours'))) %>%
  mutate(dif_72h = as.numeric(difftime(`72h_processed`,`72h_produced`, units = 'hours'))) %>%
  dplyr::select(ID, dif_0h, dif_24h, dif_48h, dif_72h) %>%
  pivot_longer(cols = starts_with('dif'), names_to = 'time', values_to = 'time_dif') %>%
  mutate(time = gsub('dif_', '', time)) %>%
  mutate(time = gsub('h', '', time)) 
fecal_dif$time %<>% factor(., levels = c(0,24,48,72))

fecal_time <- left_join(fecal_clean_sub, fecal_dif, by = c('subject_id' = 'ID', 'time'))

ft24 <- fecal_time %>%
  filter(time == 24)

ggplot(fecal_time, aes(x = time_dif, y = SFN_Tot, color = subject_id)) +
  geom_point() +
  theme_sfn() +
  scale_color_manual(values = BSS_col) +
  facet_wrap(~time, scales = 'free_y') +
  xlab('Time from Sample Production to Processing (Hours)') +
  ylab('Total SFN Metabolites (nmol/g)')

ggplot(ft24, aes(x = time_dif, y = SFN_Tot, color = subject_id)) +
  geom_point() +
  theme_sfn() +
  scale_color_manual(values = BSS_col) +
  xlab('Time from Sample Production to Processing (Hours)') +
  ylab('Total SFN Metabolites (nmol/g)') +
  ggtitle('24 Hours Only')

fecal_time %>%
  pivot_longer(cols = starts_with('SFN'), names_to = 'metabolite', values_to = 'uMol') %>%
  drop_na() %>%
  group_by(metabolite, time) %>%
  nest() %>%
  mutate(tcor = map_dbl(data, function(x) cor(x$time_dif, x$uMol))) %>%
  drop_na() %>%
  dplyr::select(-data)
## # A tibble: 14 × 3
## # Groups:   time, metabolite [14]
##    time  metabolite    tcor
##    <fct> <chr>        <dbl>
##  1 0     SFN         0.0718
##  2 0     SFN_Cys    -0.158 
##  3 0     SFN_NAC    -0.158 
##  4 0     SFN_Tot    -0.155 
##  5 24    SFN         0.0526
##  6 24    SFN_Cys     0.237 
##  7 24    SFN_NAC    -0.173 
##  8 24    SFN_NIT     0.402 
##  9 24    SFN_Tot     0.0251
## 10 48    SFN         0.558 
## 11 48    SFN_Tot     0.558 
## 12 72    SFN         0.640 
## 13 72    SFN_NIT     0.261 
## 14 72    SFN_Tot     0.670

Interestingly, it looks like the opposite of what we would have expected is happening. Instead of SFN degrading over time, it appears that the longer there is between production and collection of the sample, the greater amount of SFN is present. This could have 2 explanations:

  1. GRP is being hydrolyzed to SFN by the gut microbiome leading to the increase in SFN
  2. These participants are producing their sample relatively closer to when they consumed broccoli, thus causing them to have artificially high numbers.

Since we know what time each fecal sample was produced and what time each participant consumed their sprouts, we can examine SFN in fecal relative to sprout consumption. Essentially, we are treating fecal production time as a continuous variable as opposed to a discrete variable.

fecal_dif2 <- metadata_fecal %>%
  modify_at(3:11, mdy_hm) %>%
  mutate(across(c(`0h_produced`, `24h_produced`, `48h_produced`, `72h_produced`), 
                ~as.numeric(difftime(.x, time_consumed, units = 'hours')))) %>%
  dplyr::select(where(is.character), where(is.numeric)) %>%
  pivot_longer(cols = ends_with('produced'), names_to = 'time', values_to = 'time_passed') %>%
  mutate(time = gsub('h_produced', '', time))
fecal_dif2$time %<>% factor(., levels = c(0,24,48,72))
fecal_time2 <- left_join(fecal_clean_sub, fecal_dif2, by = c('subject_id' = 'ID', 'time'))

fti <- ggplot(fecal_time2, aes(x = time_passed, y = SFN_Tot, color = subject_id)) +
  geom_point(aes(text = paste0('Participant: ', subject_id, '\n',
                               'Cohort: ', cohort, '\n',
                               'Total SFN: ', round(SFN_Tot, 3), ' nmol/g \n',
                               'Time Passed: ', round(time_passed, 2)))) +
  theme_sfn() +
  scale_color_manual(values = BSS_col) +
  geom_vline(xintercept = 0, linetype = 'dashed') +
  geom_vline(xintercept = 24, linetype = 'dashed') +
  geom_vline(xintercept = 48, linetype = 'dashed') +
  geom_vline(xintercept = 72, linetype = 'dashed') +
  scale_x_continuous(breaks = c(0,24,48,72)) +
  xlab('Time from Eating Sprouts (Hours)') +
  ylab('Total SFN Metabolites (nmol/g)')
  
plotly::ggplotly(fti, tooltip = 'text')

Overall, it looks like fecal SFN is peaking around 24 hours and second smaller peak appears to be occurring around 48 hours. For participants, SFN excretion is being observed as early as 3 or 6 hours - it is unclear if this excretion is due to GRP hydrolysis by the gut microbiome or by entero-hepatic circulation of SFN metabolites via billiary excretion. Hopefully analysis of GRP will help to alleviate these questions.